<?php




namespace App\Http\Controllers\Api\Dynamic;


use App\Http\Controllers\Api\BasicController;
use App\Http\Controllers\Api\User\MarketLevel;
use App\Models\Dynamic\Report;
use App\Models\Dynamic\Tag;
use GatewayWorker\Lib\Gateway;
use Jiannei\Response\Laravel\Support\Facades\Response;

class ReportController extends BasicController
{


    /**
     * @api {post} /dynamic/report/add  举报
     * @apiHeader {String} Authorization='Bearer '
     */
    public function add()
    {
        $data = $this->data(['dynamic_id','reason','content','image']);
        $data['image'] = implode(',' ,$data['image']);
        $data['user_id'] = $this->uid();
        $result = Report::updateOrCreate(['user_id'=>$this->uid(),'dynamic_id'=>$data['dynamic_id']],$data);
        return Response::success($result,'举报成功');
    }



    public function reason(){
        $result=[
            '发布不当内容或信息',
            '传播色情资源，引导私下交易',
            '未成年人相关',
            '冒充他人',
            '涉嫌欺诈',
            '危害人身安全',
            '侵犯权益',
            '以上没有我想举报的类型',
        ];
        return Response::success($result);
    }
}
